package com.jch.dm.chapter_23_interpreter;

/**
 * @author: Administrator
 * <program> ::=program<command list>
 * @create: 2020/04/14 18:14
 **/
public class ProgramNode extends Node {
    private Node commandListNode;

    /**
     * 解析
     *
     * @param context
     * @throws ParseException
     */
    @Override
    public void parse(Context context) throws ParseException {
        context.skipToken("program");
        commandListNode = new CommandListNode();
        commandListNode.parse(context);
    }

    @Override
    public String toString(){
        return "[program "+ commandListNode + "]";
    }
}
